package com.yunji.common.enums.business;

import java.util.Objects;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.user.enums
 * @Title: ProductRatio
 *
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-09-04 16:35:19      V1.0        HuaAo       新建类
 */

public enum RatioType {

    SALES(1,"销售额"),
    COUNT(2,"销售量");

    RatioType(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    private final Integer code;

    private final String text;

    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static String get(Integer code)
    {
        RatioType[] enums = RatioType.values();
        for (RatioType e: enums )
        {
            if (Objects.equals(e.code, code)) { return e.text; }
        }
        return null;
    }

}